<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>表单双向数据绑定</title>
	</head>
	<body>
		<div id="app">
			<form action="https://fanyi.baidu.com/">
				<div>
					用户名:<input type="text" />
				</div>
				<div>
					<input type="submit" value="提交" />
				</div>
				<div>
					性别:<input type="radio" value="男" name="sex" v-model="sex"/>男
				        <input type="radio" value="女" name="sex" v-model="sex"/>女
				</div>
				<div>
					爱好:<input type="checkbox" name="hobby" value="敲代码" v-model="hobby" />敲代码
					<input type="checkbox" name="hobby" value="踢球" v-model="hobby" />踢球
					<input type="checkbox" name="hobby" value="打豆豆" v-model="hobby" />打豆豆
					
				</div>
				<div>
					<input type="submit" value="提交" @click.prevent="formbtn"/>
				</div>
			</form>
				
			</div>
	
		
			
		<!-- 基本语法 -->
		<script src="../js/vue.js"></script>>
		<script>
		 const app=new Vue({
			el: "#app",
			data: {
				sex:"男",
				hobby:[""]
			},
			methods:{
				formbtn(){
					alert("点击按钮")
				}
			}
		})
		</script>
	</body>
</html>
